package utils

import (
	"github.com/gin-gonic/gin"
	"net/url"
)

// Montage 拼接参数 <br />
func Montage(value url.Values) string {
	queryString := value.Encode()
	if queryString != "" {
		queryString = "?" + queryString
	}
	return ""
}

// GetFullDomain 获取长地址
//
//		   proxy_set_header Host $host;
//	       proxy_set_header X-Real-IP $remote_addr;
//	       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
//	       proxy_set_header X-Forwarded-Host $host;  # 添加此行
func GetFullDomain(c *gin.Context) string {
	domain := c.GetHeader("X-Forwarded-Host")
	if domain == "" {
		domain = c.Request.Host
	}
	return domain
}
